package tfmcbs.diagram.navigator;

import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.ITreePathLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.ViewerLabel;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
import org.eclipse.ui.navigator.ICommonLabelProvider;

import tfmcbs.Model;
import tfmcbs.diagram.edit.parts.Artifact2EditPart;
import tfmcbs.diagram.edit.parts.ArtifactEditPart;
import tfmcbs.diagram.edit.parts.ArtifactName2EditPart;
import tfmcbs.diagram.edit.parts.ArtifactNameEditPart;
import tfmcbs.diagram.edit.parts.CompositeComponent2EditPart;
import tfmcbs.diagram.edit.parts.CompositeComponent3EditPart;
import tfmcbs.diagram.edit.parts.CompositeComponentEditPart;
import tfmcbs.diagram.edit.parts.CompositeComponentName2EditPart;
import tfmcbs.diagram.edit.parts.CompositeComponentNameEditPart;
import tfmcbs.diagram.edit.parts.ConnectionEditPart;
import tfmcbs.diagram.edit.parts.ConnectionNameEditPart;
import tfmcbs.diagram.edit.parts.DependencyEditPart;
import tfmcbs.diagram.edit.parts.DependencyNameEditPart;
import tfmcbs.diagram.edit.parts.EntityExtendsEditPart;
import tfmcbs.diagram.edit.parts.Interface2EditPart;
import tfmcbs.diagram.edit.parts.InterfaceEditPart;
import tfmcbs.diagram.edit.parts.InterfaceName2EditPart;
import tfmcbs.diagram.edit.parts.InterfaceNameEditPart;
import tfmcbs.diagram.edit.parts.ManifestationEditPart;
import tfmcbs.diagram.edit.parts.ModelEditPart;
import tfmcbs.diagram.edit.parts.PortRealizationEditPart;
import tfmcbs.diagram.edit.parts.PortRealizationNameEditPart;
import tfmcbs.diagram.edit.parts.PortUsageEditPart;
import tfmcbs.diagram.edit.parts.PortUsageNameEditPart;
import tfmcbs.diagram.edit.parts.PrimitiveComponent2EditPart;
import tfmcbs.diagram.edit.parts.PrimitiveComponentEditPart;
import tfmcbs.diagram.edit.parts.PrimitiveComponentName2EditPart;
import tfmcbs.diagram.edit.parts.PrimitiveComponentNameEditPart;
import tfmcbs.diagram.edit.parts.PrimitiveRealizationEditPart;
import tfmcbs.diagram.edit.parts.PrimitiveRealizationNameEditPart;
import tfmcbs.diagram.edit.parts.PrimitiveUsageEditPart;
import tfmcbs.diagram.edit.parts.PrimitiveUsageNameEditPart;
import tfmcbs.diagram.edit.parts.ProvidingPortDelegateEditPart;
import tfmcbs.diagram.edit.parts.ProvidingPortEditPart;
import tfmcbs.diagram.edit.parts.ProvidingPortNameEditPart;
import tfmcbs.diagram.edit.parts.RequiringPortDelegateEditPart;
import tfmcbs.diagram.edit.parts.RequiringPortEditPart;
import tfmcbs.diagram.edit.parts.RequiringPortNameEditPart;
import tfmcbs.diagram.edit.parts.WrappingLabel3EditPart;
import tfmcbs.diagram.edit.parts.WrappingLabel4EditPart;
import tfmcbs.diagram.edit.parts.WrappingLabel5EditPart;
import tfmcbs.diagram.part.ComponentBasedSystemDiagramEditorPlugin;
import tfmcbs.diagram.part.ComponentBasedSystemVisualIDRegistry;
import tfmcbs.diagram.providers.ComponentBasedSystemElementTypes;
import tfmcbs.diagram.providers.ComponentBasedSystemParserProvider;

/**
 * @generated
 */
public class ComponentBasedSystemNavigatorLabelProvider extends LabelProvider
		implements ICommonLabelProvider, ITreePathLabelProvider {

	/**
	 * @generated
	 */
	static {
		ComponentBasedSystemDiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put("Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
		ComponentBasedSystemDiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put("Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	public void updateLabel(ViewerLabel label, TreePath elementPath) {
		Object element = elementPath.getLastSegment();
		if (element instanceof ComponentBasedSystemNavigatorItem
				&& !isOwnView(((ComponentBasedSystemNavigatorItem) element)
						.getView())) {
			return;
		}
		label.setText(getText(element));
		label.setImage(getImage(element));
	}

	/**
	 * @generated
	 */
	public Image getImage(Object element) {
		if (element instanceof ComponentBasedSystemNavigatorGroup) {
			ComponentBasedSystemNavigatorGroup group = (ComponentBasedSystemNavigatorGroup) element;
			return ComponentBasedSystemDiagramEditorPlugin.getInstance()
					.getBundledImage(group.getIcon());
		}

		if (element instanceof ComponentBasedSystemNavigatorItem) {
			ComponentBasedSystemNavigatorItem navigatorItem = (ComponentBasedSystemNavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return super.getImage(element);
			}
			return getImage(navigatorItem.getView());
		}

		return super.getImage(element);
	}

	/**
	 * @generated
	 */
	public Image getImage(View view) {
		switch (ComponentBasedSystemVisualIDRegistry.getVisualID(view)) {
		case PrimitiveRealizationEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://www.fit.vutbr.cz?PrimitiveRealization", ComponentBasedSystemElementTypes.PrimitiveRealization_4042); //$NON-NLS-1$
		case CompositeComponentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://www.fit.vutbr.cz?CompositeComponent", ComponentBasedSystemElementTypes.CompositeComponent_2023); //$NON-NLS-1$
		case PrimitiveComponentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://www.fit.vutbr.cz?PrimitiveComponent", ComponentBasedSystemElementTypes.PrimitiveComponent_2022); //$NON-NLS-1$
		case CompositeComponent2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://www.fit.vutbr.cz?CompositeComponent", ComponentBasedSystemElementTypes.CompositeComponent_3020); //$NON-NLS-1$
		case EntityExtendsEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://www.fit.vutbr.cz?Entity?extends", ComponentBasedSystemElementTypes.EntityExtends_4046); //$NON-NLS-1$
		case PortUsageEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://www.fit.vutbr.cz?PortUsage", ComponentBasedSystemElementTypes.PortUsage_4041); //$NON-NLS-1$
		case InterfaceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://www.fit.vutbr.cz?Interface", ComponentBasedSystemElementTypes.Interface_2024); //$NON-NLS-1$
		case Interface2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://www.fit.vutbr.cz?Interface", ComponentBasedSystemElementTypes.Interface_3021); //$NON-NLS-1$
		case PrimitiveUsageEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://www.fit.vutbr.cz?PrimitiveUsage", ComponentBasedSystemElementTypes.PrimitiveUsage_4050); //$NON-NLS-1$
		case RequiringPortDelegateEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://www.fit.vutbr.cz?RequiringPort?delegate", ComponentBasedSystemElementTypes.RequiringPortDelegate_4048); //$NON-NLS-1$
		case ArtifactEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://www.fit.vutbr.cz?Artifact", ComponentBasedSystemElementTypes.Artifact_2025); //$NON-NLS-1$
		case ConnectionEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://www.fit.vutbr.cz?Connection", ComponentBasedSystemElementTypes.Connection_4037); //$NON-NLS-1$
		case Artifact2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://www.fit.vutbr.cz?Artifact", ComponentBasedSystemElementTypes.Artifact_3022); //$NON-NLS-1$
		case DependencyEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://www.fit.vutbr.cz?Dependency", ComponentBasedSystemElementTypes.Dependency_4038); //$NON-NLS-1$
		case RequiringPortEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://www.fit.vutbr.cz?RequiringPort", ComponentBasedSystemElementTypes.RequiringPort_3015); //$NON-NLS-1$
		case ProvidingPortDelegateEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://www.fit.vutbr.cz?ProvidingPort?delegate", ComponentBasedSystemElementTypes.ProvidingPortDelegate_4047); //$NON-NLS-1$
		case ModelEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Diagram?http://www.fit.vutbr.cz?Model", ComponentBasedSystemElementTypes.Model_1000); //$NON-NLS-1$
		case ProvidingPortEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://www.fit.vutbr.cz?ProvidingPort", ComponentBasedSystemElementTypes.ProvidingPort_3014); //$NON-NLS-1$
		case ManifestationEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://www.fit.vutbr.cz?Manifestation", ComponentBasedSystemElementTypes.Manifestation_4039); //$NON-NLS-1$
		case PortRealizationEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://www.fit.vutbr.cz?PortRealization", ComponentBasedSystemElementTypes.PortRealization_4043); //$NON-NLS-1$
		case PrimitiveComponent2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://www.fit.vutbr.cz?PrimitiveComponent", ComponentBasedSystemElementTypes.PrimitiveComponent_3019); //$NON-NLS-1$
		}
		return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private Image getImage(String key, IElementType elementType) {
		ImageRegistry imageRegistry = ComponentBasedSystemDiagramEditorPlugin
				.getInstance().getImageRegistry();
		Image image = imageRegistry.get(key);
		if (image == null
				&& elementType != null
				&& ComponentBasedSystemElementTypes
						.isKnownElementType(elementType)) {
			image = ComponentBasedSystemElementTypes.getImage(elementType);
			imageRegistry.put(key, image);
		}

		if (image == null) {
			image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
			imageRegistry.put(key, image);
		}
		return image;
	}

	/**
	 * @generated
	 */
	public String getText(Object element) {
		if (element instanceof ComponentBasedSystemNavigatorGroup) {
			ComponentBasedSystemNavigatorGroup group = (ComponentBasedSystemNavigatorGroup) element;
			return group.getGroupName();
		}

		if (element instanceof ComponentBasedSystemNavigatorItem) {
			ComponentBasedSystemNavigatorItem navigatorItem = (ComponentBasedSystemNavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return null;
			}
			return getText(navigatorItem.getView());
		}

		return super.getText(element);
	}

	/**
	 * @generated
	 */
	public String getText(View view) {
		if (view.getElement() != null && view.getElement().eIsProxy()) {
			return getUnresolvedDomainElementProxyText(view);
		}
		switch (ComponentBasedSystemVisualIDRegistry.getVisualID(view)) {
		case PrimitiveRealizationEditPart.VISUAL_ID:
			return getPrimitiveRealization_4042Text(view);
		case CompositeComponentEditPart.VISUAL_ID:
			return getCompositeComponent_2023Text(view);
		case PrimitiveComponentEditPart.VISUAL_ID:
			return getPrimitiveComponent_2022Text(view);
		case CompositeComponent2EditPart.VISUAL_ID:
			return getCompositeComponent_3020Text(view);
		case EntityExtendsEditPart.VISUAL_ID:
			return getEntityExtends_4046Text(view);
		case PortUsageEditPart.VISUAL_ID:
			return getPortUsage_4041Text(view);
		case InterfaceEditPart.VISUAL_ID:
			return getInterface_2024Text(view);
		case Interface2EditPart.VISUAL_ID:
			return getInterface_3021Text(view);
		case PrimitiveUsageEditPart.VISUAL_ID:
			return getPrimitiveUsage_4050Text(view);
		case RequiringPortDelegateEditPart.VISUAL_ID:
			return getRequiringPortDelegate_4048Text(view);
		case ArtifactEditPart.VISUAL_ID:
			return getArtifact_2025Text(view);
		case ConnectionEditPart.VISUAL_ID:
			return getConnection_4037Text(view);
		case Artifact2EditPart.VISUAL_ID:
			return getArtifact_3022Text(view);
		case DependencyEditPart.VISUAL_ID:
			return getDependency_4038Text(view);
		case RequiringPortEditPart.VISUAL_ID:
			return getRequiringPort_3015Text(view);
		case ProvidingPortDelegateEditPart.VISUAL_ID:
			return getProvidingPortDelegate_4047Text(view);
		case ModelEditPart.VISUAL_ID:
			return getModel_1000Text(view);
		case ProvidingPortEditPart.VISUAL_ID:
			return getProvidingPort_3014Text(view);
		case ManifestationEditPart.VISUAL_ID:
			return getManifestation_4039Text(view);
		case PortRealizationEditPart.VISUAL_ID:
			return getPortRealization_4043Text(view);
		case PrimitiveComponent2EditPart.VISUAL_ID:
			return getPrimitiveComponent_3019Text(view);
		}
		return getUnknownElementText(view);
	}

	/**
	 * @generated
	 */
	private String getInterface_2024Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.Interface_2024, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(InterfaceNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5077); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPortRealization_4043Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.PortRealization_4043, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(PortRealizationNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 6024); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPrimitiveComponent_2022Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.PrimitiveComponent_2022, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(PrimitiveComponentNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5066); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getEntityExtends_4046Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getRequiringPortDelegate_4048Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.RequiringPortDelegate_4048,
				view.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(WrappingLabel5EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 6028); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getProvidingPort_3014Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.ProvidingPort_3014, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(ProvidingPortNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5051); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getDependency_4038Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.Dependency_4038, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(DependencyNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 6018); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getCompositeComponent_2023Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.CompositeComponent_2023, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(CompositeComponentNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5075); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPrimitiveComponent_3019Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.PrimitiveComponent_3019, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(PrimitiveComponentName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5068); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getInterface_3021Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.Interface_3021, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(InterfaceName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5070); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getRequiringPort_3015Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.RequiringPort_3015, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(RequiringPortNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5053); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getConnection_4037Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.Connection_4037, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(ConnectionNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 6017); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getManifestation_4039Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.Manifestation_4039, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(WrappingLabel3EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 6020); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPortUsage_4041Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.PortUsage_4041, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(PortUsageNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 6022); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPrimitiveUsage_4050Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.PrimitiveUsage_4050, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(PrimitiveUsageNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 6030); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getCompositeComponent_3020Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.CompositeComponent_3020, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(CompositeComponentName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5073); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPrimitiveRealization_4042Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.PrimitiveRealization_4042,
				view.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(PrimitiveRealizationNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 6023); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getArtifact_3022Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.Artifact_3022, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(ArtifactName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5071); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getModel_1000Text(View view) {
		Model domainModelElement = (Model) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getTitle();
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 1000); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getProvidingPortDelegate_4047Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.ProvidingPortDelegate_4047,
				view.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(WrappingLabel4EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 6027); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getArtifact_2025Text(View view) {
		IParser parser = ComponentBasedSystemParserProvider.getParser(
				ComponentBasedSystemElementTypes.Artifact_2025, view
						.getElement() != null ? view.getElement() : view,
				ComponentBasedSystemVisualIDRegistry
						.getType(ArtifactNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			ComponentBasedSystemDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5078); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getUnknownElementText(View view) {
		return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$  //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	private String getUnresolvedDomainElementProxyText(View view) {
		return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$  //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	public void init(ICommonContentExtensionSite aConfig) {
	}

	/**
	 * @generated
	 */
	public void restoreState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public void saveState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public String getDescription(Object anElement) {
		return null;
	}

	/**
	 * @generated
	 */
	private boolean isOwnView(View view) {
		return ModelEditPart.MODEL_ID
				.equals(ComponentBasedSystemVisualIDRegistry.getModelID(view));
	}

}
